home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / gfx / 3d / irit50src.lha / irit5 / scripts / cylin3.irt < prev    next >
Encoding:
Text File  |  1994-04-17  |  1.2 KB  |  48 lines

  1. #
  2. # A test of intersection of three orthogonal cylinders.
  3. #
  4. #                Gershon Elber, April 94.
  5. #
  6.  
  7. length = 0.7;
  8. radius = 0.2;
  9. resolution = 40;
  10.  
  11. c1 = cylin( vector( -length / 2, 0, 0 ), vector( length, 0, 0 ), radius );
  12. c2 = cylin( vector( 0, -length / 2, 0 ), vector( 0, length, 0 ), radius );
  13. c3 = cylin( vector( 0, 0, -length / 2 ), vector( 0, 0, length ), radius );
  14. attrib( c1, "width", 0.0001 );
  15. attrib( c2, "width", 0.0001 );
  16. attrib( c3, "width", 0.0001 );
  17.  
  18. c12 = c1 * c2;
  19. c123 = c12 * c3;
  20. attrib( c123, "width", 0.005 );
  21.  
  22. all = list( c123, c1, c2, c3 );
  23.  
  24. sc = 1.1;
  25. view_mat = scale( vector( sc, sc, sc ) );
  26. viewobj( view_mat );
  27.  
  28. tr = 0.4;
  29. Proj1 = all * trans( vector( -tr, tr, 0.0 ) );
  30. Proj2 = all * rotx( 90 ) * trans( vector( tr, tr, 0.0 ) );
  31. Proj3 = all * roty( 90 ) * trans( vector( -tr, -tr, 0.0 ) );
  32. Proj4 = all * roty( 30 ) * rotx( 20 ) * trans( vector( tr, -tr, 0.0 ) );
  33.  
  34. AllProj = list( Proj1, Proj2, Proj3, Proj4 );
  35.  
  36. save( "cylin3a", AllProj );
  37. view( AllProj, on );
  38.  
  39. c123a = c123 * roty( 30 ) * rotx( 20 ) * scale( vector( 3, 3, 3 ) );
  40. attrib( c123a, "width", 0.015 );
  41. save( "cylin3b", c123a );
  42. view( c123a, on );
  43.  
  44. c123b = c123 * roty( 60 ) * rotx( 65 ) * scale( vector( 3, 3, 3 ) );
  45. attrib( c123b, "width", 0.015 );
  46. save( "cylin3c", c123b );
  47. view( c123b, on );
  48.